home *** CD-ROM | disk | FTP | other *** search
- global gBallDirection, gLevel, gScore, gBallSpeed, gPaddleHits, gLocH, gLocV, gPause, gFallingBricks, gFallSprite, gDescend, h, v, pMyAngle, gGoBall, gTempTimer, gBoomFrame
-
- on prepareMovie
- gGoBall = 0
- gBoomFrame = 1
- sprite(12).locV = 220
- gLocH = 290
- gLocV = 264
- gPause = 0
- sprite(12).visible = 0
- sprite(80).visible = 0
- sprite(82).visible = 1
- gLevel = 1
- member("Level_display_a").text = "Level:" && string(gLevel)
- member("Level_display_b").text = "Level:" && string(gLevel)
- gScore = 0
- member("Score01").text = "Score:" && string(gScore)
- member("Score02").text = "Score:" && string(gScore)
- gBallSpeed = 4
- startTimer()
- end
-
- on getAngle x1, y1, x2, y2
- loc1 = [x1, y1]
- loc2 = [x2, y2]
- deltaX = loc2[1] - loc1[1]
- deltaY = -1 * (loc2[2] - loc1[2])
- if deltaY = 0 then
- if deltaX > 0 then
- return 0
- end if
- if deltaX < 0 then
- return 180
- end if
- end if
- if deltaX = 0 then
- deltaX = 0.01
- end if
- theAngle = atan(float(deltaY) / float(deltaX))
- theAngle = theAngle * 180 / PI
- if (deltaX < 0) and (deltaY > 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX < 0) and (deltaY < 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX > 0) and (deltaY < 0) then
- theAngle = 360 + theAngle
- end if
- end if
- end if
- theAngle = theAngle - 90
- if theAngle < 0 then
- theAngle = 360 + theAngle
- end if
- return theAngle
- end
-
- on deathSequence
- puppetSound(6, "kaboom")
- sprite(3).loc = sprite(2).loc
- sprite(3).visible = 1
- gBoomFrame = 1
- repeat with gBoomFrame = 1 to 13
- if gBoomFrame < 10 then
- sprite(3).member = "Explosion" & "0" & gBoomFrame
- else
- sprite(3).member = "Explosion" & gBoomFrame
- end if
- gTempTimer = the timer
- repeat while the timer < (gTempTimer + 4)
- updateStage()
- end repeat
- end repeat
- sprite(3).visible = 0
- gBoomFrame = 1
- end
-
- on loseALife
- if sprite(14).visible = 1 then
- if (gLevel >= 1) and (gLevel <= 3) then
- sprite(5).locV = 270
- sprite(5).locH = 290
- sprite(4).locH = 290
- sprite(4).locV = 270
- gLocH = 290
- gLocV = 270
- else
- if gLevel = 4 then
- gLocH = 540
- gLocV = 245
- sprite(5).locH = 540
- sprite(5).locV = 245
- sprite(4).locH = 540
- sprite(4).locV = 245
- else
- if gLevel = 5 then
- gLocH = 490
- gLocV = 270
- sprite(5).locH = 490
- sprite(5).locV = 270
- sprite(4).locH = 490
- sprite(4).locV = 270
- end if
- end if
- end if
- gBallDirection = 180.0
- gBallSpeed = 4
- gPaddleHits = 0
- sprite(14).visible = 0
- gGoBall = 0
- else
- if sprite(15).visible = 1 then
- if (gLevel >= 1) and (gLevel <= 3) then
- sprite(5).locV = 270
- sprite(5).locH = 290
- sprite(4).locV = 270
- sprite(4).locH = 290
- gLocH = 290
- gLocV = 270
- else
- if gLevel = 4 then
- gLocH = 540
- gLocV = 245
- sprite(5).locH = 540
- sprite(5).locV = 245
- sprite(4).locH = 540
- sprite(4).locV = 245
- else
- if gLevel = 5 then
- gLocH = 490
- gLocV = 270
- sprite(5).locH = 490
- sprite(5).locV = 270
- sprite(4).locH = 490
- sprite(4).locV = 270
- end if
- end if
- end if
- gBallDirection = 180.0
- gBallSpeed = 4
- gPaddleHits = 0
- sprite(15).visible = 0
- gGoBall = 0
- else
- if sprite(16).visible = 1 then
- sprite(3).locH = sprite(2).locH
- sprite(3).locV = sprite(2).locV
- sprite(3).visible = 1
- sprite(16).visible = 0
- gBallDirection = 180.0
- deathSequence()
- sprite(12).visible = 1
- gGoBall = 0
- cursor(0)
- go(75)
- end if
- end if
- end if
- end
-